#include<stdio.h>
#include<windows.h>
#include<stdbool.h>

// Definition for singly-linked list.
struct ListNode {
      int val;
      struct ListNode *next;
};



bool isPalindrome(struct ListNode* head){
    int temp[100000];
    int i = 0;
    while(head != NULL)
    {
        temp[i] = head->val;
        i++;
        
        head = head->next; 
    }

    for (int m = 0, n = i - 1; m < n ; m++, n--)
    {
        if (temp[m] != temp[n])
        {
            return false;
        }
    } 
    return true;
}